$(".openpw").click(function(){
	//var pw = $(this).children().text();
	var auth = $("#auth").val().toUpperCase();
	auth = $.trim(auth);
	/*alert$("#pw").val(pw);*/
	
	if(auth == 'ADMIN' || auth == 'LEADER'){
		 location.href = $(this).children().attr('id');
	 }else{
		var pw = $(this).attr('id');
		pw = $.trim(pw);
		//$("#url").val($(this).children().attr('id', 'empPw').);
		$("#pw").val(pw);
		if(pw == ''){
			location.href = $(this).children().attr('id');
		}else{
			$("#url").val($(this).children().attr('id'));
			$("#pwPop").center();
			$("#pwPop").css('display','');
		}
	 }
});

$("#btn_close").click(function(){
	$("#pw_confirm").val('');
	$("#pwPop").css('display','none');
});

$("#btn_confirm").click(function(){
	var str = $("#pw_confirm").val();
	
	if(str == null){
		alert('비밀번호를 입력하세요.');
	}else{
		if($("#pw").val() == str){
			location.href = $("#url").val();
		}else{
			alert('비밀번호가 틀렸습니다.');
			$("#pw_confirm").val('');
			$("#pw_confirm").focus();
		}
	}
});



jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + 
                                                $(window).scrollTop()) + "px");
    this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + 
                                                $(window).scrollLeft()) + "px");
    return this;
}